package org.four;

/**
 * Created by Administrator on 2016/3/14 0014.
 */
public class TestSuperThread extends Thread {

    @Override
    public void run() {
        for ( int i = 0; i < 10; i++ ) {
            System.out.println(this.getName() + "当前值：" + i);
            try {
                sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

class TestThread {
    public static void main(String[] args) {
        TestSuperThread t1 = new TestSuperThread();
        t1.setName("线程A");
        TestSuperThread t2 = new TestSuperThread();
        t2.setName("线程B");

        t1.start();
        t2.start();
    }
}
